home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
014
/
qf23d.arc
/
QF23.PAT
< prev
next >
Wrap
Text File
|
1986-11-08
|
3KB
|
66 lines
N QFILER.COM
L
A 33A8
Mov AH,3 ;Get current cursor pos. to save it
Int 10
Push DX ;Save cursor pos. on stack
Mov CL,[BP+4] ;CL = string length
Xor CH,CH ;CH = 0, to set CX to string length
Xor SI,SI ;SI = 0
And CL,CL ;If null string, jump to end, do nothing
Jz 33F1
Push CX ;Save chars left to write on stack [33B8:]
Inc SI ;Incr pointer to char in string
Mov DH,[BP+57] ;Screen row
Mov DL,[BP+59] ;Screen column
Inc Byte Ptr [BP+59] ;Incr. column position
Xor BH,BH ;Display page 0 (BH=0)
Mov AH,2 ;Set cursor position
Int 10
Mov CX,1 ;CX = count of characters to write, will be >= 1
Xor BH,BH ;Display page 0
Mov BL,[BP+55] ;Get attribute
Mov AL,[BP+SI+4] ;Get next character to write
Mov AH,9 ;Func 9 of int 10 = write char & attrib at cursor pos.
Cmp AL,[BP+SI+5] ;See if next char is exactly the same [33D6:]
Jnz 33EC ;If not, write this character
Pop DX ;Pop char's left in string
Cmp DX,1 ;See if this is the last one
Push DX ;Put back
Jz 33EC ;If last char, also go ahead and write the char
Pop DX ;Next char is same as this one, so...
Dec DX ;Decrement char's left counter
Push DX
Inc SI ;Incr. position
Inc CX ;Incr # of chars we want BIOS to write
Inc Byte Ptr [BP+59] ;Incr column to write at
Jmp 33D6 ;Loop to see if next char is also identical
Int 10 ;Write CX copies of char and attrib [33EC:]
Pop CX ;Get # of chars left
Loop 33B8 ;Loop if more to do
Pop DX ;Get back original cursor position [33F1:]
Xor BH,BH ;Display page 0
Mov AH,2 ;Set cursor position function
Int 10
Jmp 3413 ;Jump to original end of FastWrite code [33F8:]
W
Q
This file contains a patch for QFiler 2.3 to route all text writing
through BIOS calls rather than direct writing to RAM. It is significantly
faster than an ordinary writeln for strings of repeated characters, though,
because it checks for repeated characters, and if found, it will write them
all with one BIOS call, requesting the appropriate number of copies.
It is, of course, painfully slow, but it is even slower without this
feature.
This patch does NOT alter the full-screen saves and restores that QFiler does,
for example when you press 'H' for help, but the screen can be restored by
pressing Alt-R, so I didn't bother.
The starting address of the original FastWrite code can be found with
debug with: S 100 FFFE 1E 1E 8A 86 57 00
To use, type something like:
Debug < QF23.PAT